<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
 <%@taglib prefix="s" uri="/struts-tags"%>
 <%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>

</head>
<body>
<div class="container">
   
    <div class="panel panel-default">

        <div class="panel-heading">
            <div class="panel-title">
			<h3 class="text-center">订单处理</h3>
               <form role="search" class="form-horizontal">
				 
                    <div class="form-group">

                       

                        
                        <div class="col-lg-2">

                            <input type="text" id="txt_order_id" placeholder="输入订单号:" class="form-control"/>

                        </div>
                       
                        
                        

                        <div class="col-lg-1">
                            <button type="button" value="搜索" onclick="btn_order_search()" class="btn btn-primary">
                                <span class="glyphicon glyphicon-search"></span>
                                搜索
                            </button>

                        </div>

                    </div>

                </form>
            </div>
        </div>
		 
		<s:if test="#request.orderList != null && #request.orderList.size() > 0">
        <table class="table table-bordered text-center table-hover">

            <thead>
				<tr >
					<th class="text-center">订单编号</th>
					<th class="text-center">用户名</th>
					<th class="text-center">订单时间</th>
					<th class="text-center">订单状态</th>
					<th class="text-center">订单总额(元)</th>
					<th class="text-center">处理</th>
				</tr>
            </thead>
            <tbody>
            <s:iterator id="var_order" value="#request.orderList">
									<tr>
										<td>${var_order. orderId }</td>
										<td>${var_order.users.realName }</td>
										<td>${var_order.orderTime }</td>
										
										<td>${var_order.orderState }</td>
										<td>${var_order.sumPrice }</td>
										<td>
											<s:if test="#var_order.orderState == '未处理'">
												<button type="button"  onclick="btn_order_do(${var_order.orderId})" class="btn btn-info">
													<span class="glyphicon glyphicon-plus">租赁</span>
												</button>
											</s:if>
											<s:elseif test="#var_order.orderState == '已归还'">
												<button type="button"  class="btn btn-success">
													<span class="glyphicon glyphicon-heart-empty"></span>
												</button>
												
											</s:elseif>
											
											<s:else>
												<button type="button"  onclick="btn_order_back(${var_order.orderId})" class="btn btn-primary">
													<span class="glyphicon glyphicon-refresh">归还</span>
												</button>
											</s:else>
										</td>
									</tr>
			</s:iterator>
            </tbody>

        </table>
		<ul class="pager">
							<s:if test="pager.curPage > 1">
								<li><a href="admin/searchOrder?pager.curPage=1">首页</a></li>
								<li><a href="admin/searchOrder?pager.curPage=${pager.curPage - 1 }">上一页</a></li>
							</s:if>
							<s:if test="pager.curPage < pager.pageCount ">
								<li><a href="admin/searchOrder?pager.curPage=${pager.curPage + 1 }">下一页</a></li>
								<li><a href="admin/searchOrderr?pager.curPage=${pager.pageCount }">尾页</a></li>
							</s:if>
							<li><a>总共${pager.rowCount }记录,共${pager.curPage }/${pager.pageCount }页</a></li>
		</ul>
		</s:if>
						<s:else>
							<h3 class="text-center text-danger">暂无查询信息!</div>
						</s:else>

    </div>
   </div>

			
</body>
</html>